package Demo1299.Demo7;

import org.apache.commons.io.FileUtils;

import java.io.File;
import java.lang.reflect.Field;
import java.util.List;

public class Dmeo1 {
    public static void main(String[] args) throws Exception {
        List<String> list = FileUtils.readLines(new File("C:\\Daymate\\src\\Demo1299\\Demo7\\CatData.txt"));
        for (String s : list) {
            Class<?> aClass = Class.forName(s.split(" ")[0]);
            Object cat = aClass.getDeclaredConstructor().newInstance();
            Field name = aClass.getDeclaredField("name");
            name.setAccessible(true);
            name.set(cat,s.split("’")[1]);
            System.out.println(name.get(cat));
        }
    }
}
